﻿using Himp.Platform;
using System.Reflection.Emit;
using Volo.Abp;
using Volo.Abp.MongoDB;

namespace Himp.DataHub.MongoDB;

public static class DataHubMongoDbContextExtensions
{
    public static void ConfigureDataHub(
        this IMongoModelBuilder builder)
    {
        Check.NotNull(builder, nameof(builder));

        builder.Entity<PatnMasterIdx>(b =>
        {
            b.CollectionName = "PatnMasterIdxs";
        });

        #region 科室

        builder.Entity<DeptInfo>(b =>
        {
            b.CollectionName = "DeptInfo";
        });

        //builder.Entity<DeptAttr>(b =>
        //{
        //    b.CollectionName = "DeptAssocAttrs";
        //});

        //builder.Entity<DeptConsultRm>(b =>
        //{
        //    b.CollectionName = "DeptConsultRms";
        //});

        //builder.Entity<DeptWard>(b =>
        //{
        //    b.CollectionName = "DeptWards";
        //});

        #endregion

        #region 人员

        builder.Entity<PsnInfo>(b =>
        {
            b.CollectionName = "PsnInfo";
        });

        builder.Entity<PatnBaseInfo>(b =>
        {
            b.CollectionName = "PatnBaseInfo";
        });

        #endregion

        #region 公共项目

        builder.Entity<PubItem>(b =>
        {
            b.CollectionName = "PubItems";
        });

        #endregion

        #region 药品

        builder.Entity<DrugCatalog>(b =>
        {
            b.CollectionName = "DrugCatalogs";
        });

        builder.Entity<DrugCatalogExt>(b =>
        {
            b.CollectionName = "DrugCatalogExts";
        });

        builder.Entity<DrugPrdr>(b =>
        {
            b.CollectionName = "DrugPrdrs";
        });

        builder.Entity<DrugMedcWayGrp>(b =>
        {
            b.CollectionName = "DrugMedcWayGrps";
        });

        builder.Entity<DrugCatalogType>(b =>
        {
            b.CollectionName = "DrugCatalogTypes";
        });

        #endregion

        #region 疾病诊断

        builder.Entity<DiseDiagDict>(b =>
        {
            b.CollectionName = "DiseDiagDict";
        });

        builder.Entity<ClncDiagDict>(b =>
        {
            b.CollectionName = "ClncDiagDict";
        });

        #endregion
    }
}
